home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _OBJECT.FRM < prev    next >
Text File  |  1996-05-14  |  16KB  |  438 lines

  1. VERSION 4.00
  2. Begin VB.Form frmObject 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Object"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   3270
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSFrame SSFrame1 
  31.       Height          =   750
  32.       Index           =   1
  33.       Left            =   105
  34.       TabIndex        =   1
  35.       Tag             =   "Tag for SSFrame1"
  36.       Top             =   3990
  37.       Width           =   7260
  38.       _Version        =   65536
  39.       _ExtentX        =   12806
  40.       _ExtentY        =   1323
  41.       _StockProps     =   14
  42.       Caption         =   "Test Frame"
  43.       MousePointer    =   13
  44.       Begin VB.Label Label1 
  45.          Alignment       =   2  'Center
  46.          Caption         =   "Test Label"
  47.          DataField       =   "DataField for Label1"
  48.          ForeColor       =   &H00FF0000&
  49.          Height          =   330
  50.          Left            =   105
  51.          MousePointer    =   14  'Arrow and Question
  52.          TabIndex        =   2
  53.          Tag             =   "Tag for Label1"
  54.          Top             =   315
  55.          Width           =   7050
  56.       End
  57.    End
  58.    Begin Threed.SSPanel SSPanel1 
  59.       Align           =   1  'Align Top
  60.       Height          =   480
  61.       Left            =   0
  62.       TabIndex        =   3
  63.       Top             =   0
  64.       Width           =   7485
  65.       _Version        =   65536
  66.       _ExtentX        =   13203
  67.       _ExtentY        =   847
  68.       _StockProps     =   15
  69.       ForeColor       =   -2147483640
  70.       BackColor       =   12632256
  71.       Begin VB.ComboBox cmb_Function 
  72.          Height          =   315
  73.          Left            =   1365
  74.          TabIndex        =   4
  75.          Top             =   90
  76.          Width           =   4785
  77.       End
  78.       Begin Threed.SSCommand cmdNP 
  79.          Height          =   300
  80.          Index           =   1
  81.          Left            =   7140
  82.          TabIndex        =   8
  83.          Top             =   90
  84.          Width           =   255
  85.          _Version        =   65536
  86.          _ExtentX        =   450
  87.          _ExtentY        =   529
  88.          _StockProps     =   78
  89.          Caption         =   ">"
  90.          BevelWidth      =   1
  91.          Font3D          =   3
  92.          RoundedCorners  =   0   'False
  93.          Outline         =   0   'False
  94.       End
  95.       Begin Threed.SSCommand cmdNP 
  96.          Height          =   300
  97.          Index           =   0
  98.          Left            =   6300
  99.          TabIndex        =   7
  100.          Top             =   90
  101.          Width           =   255
  102.          _Version        =   65536
  103.          _ExtentX        =   450
  104.          _ExtentY        =   529
  105.          _StockProps     =   78
  106.          Caption         =   "<"
  107.          BevelWidth      =   1
  108.          Font3D          =   3
  109.          RoundedCorners  =   0   'False
  110.          Outline         =   0   'False
  111.       End
  112.       Begin VB.Label Label2 
  113.          Caption         =   "&Select a function"
  114.          Height          =   255
  115.          Left            =   90
  116.          TabIndex        =   6
  117.          Top             =   120
  118.          Width           =   1275
  119.       End
  120.       Begin Threed.SSCommand SSCommand1 
  121.          Default         =   -1  'True
  122.          Height          =   300
  123.          Left            =   6615
  124.          TabIndex        =   5
  125.          Top             =   90
  126.          Width           =   465
  127.          _Version        =   65536
  128.          _ExtentX        =   820
  129.          _ExtentY        =   529
  130.          _StockProps     =   78
  131.          Caption         =   "&Go"
  132.          BevelWidth      =   1
  133.          RoundedCorners  =   0   'False
  134.          Outline         =   0   'False
  135.       End
  136.    End
  137. End
  138. Attribute VB_Name = "frmObject"
  139. Attribute VB_Creatable = False
  140. Attribute VB_Exposed = False
  141. Option Explicit
  142. Option Base 1
  143.  
  144. Private Const Iteration = 250
  145.  
  146. Dim IsLoaded         As Integer
  147.  
  148. Dim TimerStartOk     As Integer
  149. Dim TimerCloseOk     As Integer
  150.  
  151. Dim TimerHandle      As Integer
  152. Dim TimerValue       As Long
  153.  
  154. Private Sub cmdNP_Click(Index As Integer)
  155.  
  156.    Call sub_NextPrev(cmb_Function, Index)
  157.  
  158. End Sub
  159.  
  160.  
  161. Private Sub cmb_Function_Click()
  162.    
  163.    If (IsLoaded = False) Then Exit Sub
  164.    
  165.    Call cDisableFI(mdiT2W.Picture1)
  166.    
  167.    txt_Result = ""
  168.    
  169.    DoEvents
  170.    
  171.    Select Case cmb_Function.ListIndex
  172.       Case 0
  173.          Call TestObjectGetX
  174.       Case 1
  175.          Call TestGetObjX
  176.       Case 2
  177.          Call TestObjectPutX
  178.       Case 3
  179.          Call TestPutObjX
  180.    End Select
  181.  
  182.    DoEvents
  183.    Call cEnableFI(mdiT2W.Picture1)
  184.    
  185. End Sub
  186.  
  187.  
  188. Private Sub Form_Activate()
  189.  
  190.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  191.  
  192. End Sub
  193.  
  194. Private Sub Form_Load()
  195.  
  196.    IsLoaded = False
  197.    
  198.    Show
  199.  
  200.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_object.t2w")
  201.    
  202.    IsLoaded = True
  203.    
  204. End Sub
  205.  
  206. Private Sub SSCommand1_Click()
  207.    
  208.    Call cmb_Function_Click
  209.    
  210. End Sub
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. Private Sub TestObjectGetX()
  219.  
  220.    Dim intResult        As Integer
  221.    Dim strResult        As String
  222.    Dim strDisplay       As String
  223.    
  224.    Dim i                As Integer
  225.    
  226.    strResult = ""
  227.    strDisplay = ""
  228.  
  229.    strDisplay = strDisplay & "ObjectGetX for SSFrame1(1)" & vbCrLf & vbCrLf
  230.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(SSFrame1(1), "enabled") & "'" & vbCrLf
  231.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(SSFrame1(1), "alignment") & "'" & vbCrLf
  232.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(SSFrame1(1), "mousepointer") & "'" & vbCrLf
  233.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(SSFrame1(1), "forecolor") & "'" & vbCrLf
  234.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(SSFrame1(1), "caption") & "'" & vbCrLf
  235.    strDisplay = strDisplay & "Variant (property 'tabindex') is '" & cObjectGetVariant(SSFrame1(1), "tabindex") & "'" & vbCrLf
  236.    strDisplay = strDisplay & "Variant (property 'caption') is '" & cObjectGetVariant(SSFrame1(1), "caption") & "'" & vbCrLf
  237.    strDisplay = strDisplay & "Variant (property 'visible') is '" & cObjectGetVariant(SSFrame1(1), "visible") & "'" & vbCrLf
  238.    strDisplay = strDisplay & "Index (property 'index') is '" & cObjectGetIndex(SSFrame1(1)) & "'" & vbCrLf
  239.  
  240.    strDisplay = strDisplay & vbCrLf
  241.    
  242.    strDisplay = strDisplay & "ObjectGetX for Label1" & vbCrLf & vbCrLf
  243.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(Label1, "enabled") & "'" & vbCrLf
  244.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(Label1, "alignment") & "'" & vbCrLf
  245.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(Label1, "mousepointer") & "'" & vbCrLf
  246.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(Label1, "forecolor") & "'" & vbCrLf
  247.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(Label1, "caption") & "'" & vbCrLf
  248.    strDisplay = strDisplay & "Variant (property 'tabindex') is '" & cObjectGetVariant(Label1, "tabindex") & "'" & vbCrLf
  249.    strDisplay = strDisplay & "Variant (property 'caption') is '" & cObjectGetVariant(Label1, "caption") & "'" & vbCrLf
  250.    strDisplay = strDisplay & "Variant (property 'visible') is '" & cObjectGetVariant(Label1, "visible") & "'" & vbCrLf
  251.    strDisplay = strDisplay & "Index (property 'index') is '" & cObjectGetIndex(Label1) & "'"
  252.  
  253.    txt_Result = strDisplay
  254.    
  255.    'time the function
  256.  
  257.    TimerHandle = cTimerOpen()
  258.    TimerStartOk = cTimerStart(TimerHandle)
  259.    
  260.    For i = 1 To Iteration
  261.       strResult = cObjectGetString(cmb_Function, "text")
  262.    Next i
  263.    
  264.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  265.    
  266.    TimerCloseOk = cTimerClose(TimerHandle)
  267.  
  268. End Sub
  269.  
  270. Private Sub TestGetObjX()
  271.  
  272.    Dim intResult        As Integer
  273.    Dim strResult        As String
  274.    Dim strDisplay       As String
  275.    
  276.    Dim i                As Integer
  277.    
  278.    strResult = ""
  279.    strDisplay = ""
  280.  
  281.    strDisplay = strDisplay & "GetObjX for SSFrame1(1)" & vbCrLf & vbCrLf
  282.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(SSFrame1(1)) & "'" & vbCrLf
  283.    strDisplay = strDisplay & "Container is '" & cGetObjContainer(SSFrame1(1)) & "'" & vbCrLf
  284.    strDisplay = strDisplay & "Parent is '" & cGetObjParent(SSFrame1(1)) & "'" & vbCrLf
  285.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(SSFrame1(1)) & "'" & vbCrLf
  286.    strDisplay = strDisplay & "Text is '" & cGetObjText(SSFrame1(1)) & "'" & vbCrLf
  287.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(SSFrame1(1)) & "'" & vbCrLf
  288.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(SSFrame1(1)) & "'" & vbCrLf
  289.    strDisplay = strDisplay & "Name is '" & cGetObjName(SSFrame1(1)) & "'" & vbCrLf
  290.    strDisplay = strDisplay & "Index is '" & cGetObjIndex(SSFrame1(1)) & "'" & vbCrLf
  291.    strDisplay = strDisplay & "NameIndex is '" & cGetObjNameIndex(SSFrame1(1)) & "'" & vbCrLf
  292.    strDisplay = strDisplay & "ClassName is '" & cGetObjClassName(SSFrame1(1)) & "'" & vbCrLf
  293.  
  294.    strDisplay = strDisplay & vbCrLf
  295.    
  296.    strDisplay = strDisplay & "GetObjX for Label1" & vbCrLf & vbCrLf
  297.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(Label1) & "'" & vbCrLf
  298.    strDisplay = strDisplay & "Container is '" & cGetObjContainer(Label1) & "'" & vbCrLf
  299.    strDisplay = strDisplay & "Parent is '" & cGetObjParent(Label1) & "'" & vbCrLf
  300.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(Label1) & "'" & vbCrLf
  301.    strDisplay = strDisplay & "Text is '" & cGetObjText(Label1) & "'" & vbCrLf
  302.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(Label1) & "'" & vbCrLf
  303.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(Label1) & "'" & vbCrLf
  304.    strDisplay = strDisplay & "Name is '" & cGetObjName(Label1) & "'" & vbCrLf
  305.    strDisplay = strDisplay & "Index is '" & cGetObjIndex(Label1) & "'" & vbCrLf
  306.    strDisplay = strDisplay & "NameIndex is '" & cGetObjNameIndex(Label1) & "'" & vbCrLf
  307.    strDisplay = strDisplay & "ClassName is '" & cGetObjClassName(Label1) & "'" & vbCrLf
  308.  
  309.    txt_Result = strDisplay
  310.    
  311.    'time the function
  312.  
  313.    TimerHandle = cTimerOpen()
  314.    TimerStartOk = cTimerStart(TimerHandle)
  315.    
  316.    For i = 1 To Iteration
  317.       strResult = cGetObjContainer(cmb_Function)
  318.    Next i
  319.    
  320.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  321.    
  322.    TimerCloseOk = cTimerClose(TimerHandle)
  323.  
  324. End Sub
  325.  
  326. Private Sub TestObjectPutX()
  327.  
  328.    Dim intResult        As Integer
  329.    Dim strResult        As String
  330.    Dim strDisplay       As String
  331.    
  332.    Dim i                As Integer
  333.    
  334.    strResult = ""
  335.    strDisplay = ""
  336.  
  337.    strDisplay = strDisplay & "ObjectPutX for SSFrame1(1)" & vbCrLf & vbCrLf
  338.    Call cObjectPutBoolean(SSFrame1(1), "enabled", False)
  339.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(SSFrame1(1), "enabled") & "'" & vbCrLf
  340.    Call cObjectPutByte(SSFrame1(1), "alignment", 1)
  341.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(SSFrame1(1), "alignment") & "'" & vbCrLf
  342.    Call cObjectPutInteger(SSFrame1(1), "mousepointer", 7)
  343.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(SSFrame1(1), "mousepointer") & "'" & vbCrLf
  344.    Call cObjectPutLong(SSFrame1(1), "forecolor", &HC0C0C0)
  345.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(SSFrame1(1), "forecolor") & "'" & vbCrLf
  346.    Call cObjectPutString(SSFrame1(1), "caption", "SSFrame1(1).Caption is now this")
  347.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(SSFrame1(1), "caption") & "'" & vbCrLf
  348.  
  349.    strDisplay = strDisplay & vbCrLf
  350.    
  351.    strDisplay = strDisplay & "ObjectPutX for Label1" & vbCrLf & vbCrLf
  352.    Call cObjectPutBoolean(Label1, "enabled", False)
  353.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(Label1, "enabled") & "'" & vbCrLf
  354.    Call cObjectPutByte(Label1, "alignment", 1)
  355.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(Label1, "alignment") & "'" & vbCrLf
  356.    Call cObjectPutInteger(Label1, "mousepointer", 7)
  357.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(Label1, "mousepointer") & "'" & vbCrLf
  358.    Call cObjectPutLong(Label1, "forecolor", &HC0C0C0)
  359.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(Label1, "forecolor") & "'" & vbCrLf
  360.    Call cObjectPutString(Label1, "caption", "Label1.Caption is now this")
  361.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(Label1, "caption") & "'" & vbCrLf
  362.  
  363.    txt_Result = strDisplay
  364.    
  365.    'time the function
  366.  
  367.    TimerHandle = cTimerOpen()
  368.    TimerStartOk = cTimerStart(TimerHandle)
  369.    
  370.    For i = 1 To Iteration
  371.       If ((i Mod 2) = 0) Then
  372.          Call cObjectPutByte(Label1, "borderstyle", 0)
  373.       Else
  374.          Call cObjectPutByte(Label1, "borderstyle", 1)
  375.       End If
  376.       DoEvents
  377.    Next i
  378.    
  379.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  380.    
  381.    TimerCloseOk = cTimerClose(TimerHandle)
  382.  
  383. End Sub
  384.  
  385. Private Sub TestPutObjX()
  386.  
  387.    Dim intResult        As Integer
  388.    Dim strResult        As String
  389.    Dim strDisplay       As String
  390.    
  391.    Dim i                As Integer
  392.    
  393.    strResult = ""
  394.    strDisplay = ""
  395.  
  396.    strDisplay = strDisplay & "PutObjX for SSFrame1(1)" & vbCrLf & vbCrLf
  397.    Call cPutObjCaption(SSFrame1(1), "SSFrame1(1).Caption set by PutObjCaption")
  398.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(SSFrame1(1)) & "'" & vbCrLf
  399.    Call cPutObjDataField(SSFrame1(1), "DataField set by PutObjDataField")
  400.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(SSFrame1(1)) & "'" & vbCrLf
  401.    Call cPutObjDataSource(SSFrame1(1), "DataSource set by PutObjSource")
  402.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(SSFrame1(1)) & "'" & vbCrLf
  403.    Call cPutObjTag(SSFrame1(1), "Tag set by PutObjTag")
  404.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(SSFrame1(1)) & "'" & vbCrLf
  405.    Call cPutObjText(SSFrame1(1), "Text set by PutObjText")
  406.    strDisplay = strDisplay & "Text is '" & cGetObjText(SSFrame1(1)) & "'" & vbCrLf
  407.  
  408.    strDisplay = strDisplay & vbCrLf
  409.    
  410.    strDisplay = strDisplay & "PutObjX for Label1" & vbCrLf & vbCrLf
  411.    Call cPutObjCaption(Label1, "Label1.Caption set by PutObjCaption")
  412.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(Label1) & "'" & vbCrLf
  413.    Call cPutObjDataField(Label1, "DataField set by PutObjDataField")
  414.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(Label1) & "'" & vbCrLf
  415.    Call cPutObjDataSource(Label1, "DataSource set by PutObjSource")
  416.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(Label1) & "'" & vbCrLf
  417.    Call cPutObjTag(Label1, "Tag set by PutObjTag")
  418.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(Label1) & "'" & vbCrLf
  419.    Call cPutObjText(Label1, "Text set by PutObjText")
  420.    strDisplay = strDisplay & "Text is '" & cGetObjText(Label1) & "'" & vbCrLf
  421.  
  422.    txt_Result = strDisplay
  423.    
  424.    'time the function
  425.  
  426.    TimerHandle = cTimerOpen()
  427.    TimerStartOk = cTimerStart(TimerHandle)
  428.    
  429.    For i = 1 To Iteration
  430.       Call cPutObjTag(cmb_Function, "Tag set by PutObjTag")
  431.    Next i
  432.    
  433.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  434.    
  435.    TimerCloseOk = cTimerClose(TimerHandle)
  436.  
  437. End Sub
  438.